<link href="./css/style.css" rel="stylesheet" type="text/css" />
<div class="main">
<div class="mlist">
	<p class="tt"><a>首页</a>><a href="userlist.php">会员管理</a>><span>留言列表</span></p>
	<div class="list">
	{if($msg==0)}
	<p class='none'>未查询到资料</p>
	{else}
	<ul>
		{loop $mlist $key as $list}
		<li>
			<span class='cz'>
				<a href="message.php?mid={$list[Id]}">{if($list['state']==1)}查看{else}回复{/if}</a>
				<a href="javascript:" onclick=del({$list[Id]})>删除</a>
			</span>
			<p class="p1">
				<span class="s1">留言账户：<font>{$list[uname]}</font></span>
				<span class="s2">留言内容：<font>{$list[content]}</font></span>
				<span class="s3">留言时间：<font>{$list[addtime]}</font></span>
				{if($list['state']==1)}<span class="s4">回复内容：{$list[replay]}</span>
				<span class="s5">回复时间：{$list[replaytime]}</span>{/if}
				{if($list['state']==0)}<span class='s6'>留言状态：未回复</span>{/if}
			</p>
		</li>
	{/loop}
	</ul>
	{$page}
	{/if}
	<script src="./js/jquery.js"></script>
	<script>
		function del(id){
			var message = confirm("确认删除？");
			if(message == true){				
				$.ajax({
					type:"post",
					dataType:"json",
					url:"/Moudel.php?m=m&a=mdel",
					data:"id="+id,
					success:function(d){
						if(d[0]==0){
							alert(d[1]);
						}
						else{
							alert(d[1]);
							window.location.href='messagelist.php';
						}
					}
				});
			}
			else{
				return false;
			}
		}

	</script>
	<script>
		h1 = $(".main").height();
		h2 = $(".mlist").height();
		if(h2>h1){
			$(".main").css("height","auto");
		}
		$('tr').click(function(){	
			$('tr').removeClass('onactive');
			$(this).addClass('onactive');
		});
	</script>
	</div>
</div>
</div>